#!/bin/sh
 
NAME="wp-"
PRE=`date +%Y%m%d-%H%M%S`
WP_PATH="/home/www/wp"
BACKUP_PATH="/home/backup"
DB_USERNAME="root"
DB_PASSWORD="gojava"
DB_NAME="test"
 
#backup blog
tar zcvf $NAME-$PRE.tar.gz $WP_PATH
mv $NAME-$PRE.tar.gz $BACKUP_PATH
#backup blog db
mysqldump -u${DB_USERNAME} -p${DB_PASSWORD} $DB_NAME | gzip > $NAME-$PRE.sql.gz
mv $NAME-$PRE.sql.gz $BACKUP_PATH
echo "wpdatabackup" | mutt -a $BACKUP_PATH/$NAME-$PRE.sql.gz -a $BACKUP_PATH/$NAME-$PRE.tar.gz -s "the wpdata backup" 532951243@qq.com
echo 1 > /home/www/wp/wp-content/themes/count.dat
